﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Entities
{
    [Serializable]
    public class CoachOfSchedule
    {
        private int coachID;
        private int scheduleID;
        public CoachOfSchedule()
        { }
        public CoachOfSchedule(int coachID, int scheduleID)
        {
            this.coachID = coachID;
            this.scheduleID = scheduleID;
        }
        public int CoachID
        {
            get { return this.coachID; }
            set
            {
                if (value < 0)
                    throw new Exception("coachID not allow nullvalue.");
                this.coachID = value;
            }
        }
        public int ScheduleID
        {
            get { return this.scheduleID; }
            set
            {
                if (value < 0)
                    throw new Exception("scheduleID not allow nullvalue.");
                this.scheduleID = value;
            }
        }
        public override string ToString()
        {
            return this.coachID + "; " + this.scheduleID + "; ";
        }
        public override bool Equals(Object obj)
        {
            CoachOfSchedule me = (CoachOfSchedule)obj;
            bool ret = this.CoachID.Equals(me.CoachID) && this.ScheduleID.Equals(me.ScheduleID);
            return ret;
        }
        public override int GetHashCode()
        {
            return this.CoachID.GetHashCode() + this.ScheduleID.GetHashCode();
        }

    }
}